<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>getElementById</title>
</head>
<body>
    <div id="app"></div>
    <script>
        // getElementById是document的方法
        console.log(document.getElementById("app"));

        var app = 'hd';
        // 如果id的名字没有被当做变量，可以直接用window.id名
        console.log(window.app);
    </script>
</body>
</html>